package core1.ch05extends;
class Base{
	public String getFields(){
		String name="Base";
		return name;
	}
}
class Agg extends Base{
	public String getFields(){
		String name="Agg";
		return name;
	}
}
public class HelloWorld4 {
	
	
public static void main(String[] args) {
	Base a =new Agg();
	System.out.println(a.getFields());
	System.out.println(((Agg)a).getFields());
}
}
